<template>
  <transition appear name="rightNav">
    <aside class="right-nav">
      <section>
        <div class="avtar">
          <img src="../../../assets/image/right-bg.jpeg" alt="" />
        </div>
        <div class="info">
          <p class="name">{{ info.username }}</p>
          <p class="nav-title">{{ info.title }}</p>
        </div>

        <div class="nav-bottom">
          <div class="article-show article-num">
            <div class="num">{{ info.article_num }}</div>
            <div class="text">文章数</div>
          </div>
          <div class="article-show">
            <div class="num">{{ info.read_num }}</div>
            <div class="text">浏览量</div>
          </div>
        </div>
      </section>
    </aside>
  </transition>
</template>

<script>
export default {
  name: "rightnav",
  props: {
    info:Object,
  },
};
</script>

<style scoped lang="scss">
.right-nav {
  width: 262px;
  margin: 15px;
  section {
    width: 262px;
    height: 300px;
    background-color: #fff;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.3);
    border-radius: 18px;
    overflow: hidden;
    user-select: none;
    transition: all 0.7s;
    .avtar {
      width: 100%;
      height: 140px;
      overflow: hidden;
      margin: 0 auto;
      position: relative;
      img {
        width: 100%;
        height: 100%;
        background-size: cover;
      }
    }

    .info {
      width: 100%;
      margin-top: 20px;
      .name {
        font-family: Optima-Regular, Optima, -apple-system, system-ui;
        text-align: center;
        font-size: 20px;
      }
      .nav-title {
        text-align: center;
        font-size: 13px;
        margin-top: 10px;
      }
    }
    .nav-bottom {
      width: 80%;
      margin-top: 22px;
      display: flex;
      justify-content: space-around;
      margin: 22px auto 0;
      .article-show {
        width: 75px;
        text-align: center;
        .num {
          font-size: 24px;
          color: skyblue;
        }
        .text {
          font-size: 15px;
          font-weight: 400;
        }
      }
      .article-num {
        padding-right: 20px;
        border-right: 1px solid #aaa;
      }
    }
  }
}
.right-nav:hover {
  .avtar {
    img {
      transform: scale(1.105);
      transition: all 0.6s;
    }
  }
}
.rightNav-enter-active,
.rightNav-leave-active {
  transition: all 0.7s ease-in-out;
}

.rightNav-enter,
.rightNav-leave-to {
  opacity: 0;
  transform: translateX(275px);
}
.rightNav-enter-to,
.rightNav-leave {
  opacity: 1;
  transform: translateX(0);
}

@media screen and (min-width: 650px) and (max-width: 1100px) {
  .right-nav {
    display: none;
  }
}
@media screen and (max-width: 650px){
  .right-nav {
    display: none;
  }
}
</style>